import Taro from "@tarojs/taro"

type TLogin = {
  code: string
}

/**
 * @description: 调用接口获取登录凭证
 * @return {*}
 */
export const login = () => {
  return new Promise<TLogin>((resolve, reject) => {
    Taro.login({
      success: function (res) {
        resolve(res)
      },
      fail: function () {
        reject()
      }
    })
  })
}

export default {
  login
}
